<?php  echo $this->render('global/map.phtml'); ?>		
      
      
     <script type="text/javascript">

    
 	
     $(document).ready(function(){
    	  
    	 $('#google_map').ready(function() {
 
    	   		//load();
    		 load({lx : <?php echo $this->lx;?>, ly : <?php echo $this->ly;?>});

     });

    	 $('#button').mouseup(function() {
    		
    		 $('#city_loc').attr('value', save());

     }); 
    	 $('#button2').mouseup(function() {
     		
    		 $('#city_loc').attr('value', save());

     }); 

    	 
    });
    	
    		     
     
</script>
     
        
        
<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpsetings/list">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" id="button2" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
	</tr>
</table>



<form id="formitem" action="<?php echo $this->baseUrl() ?>/cpsetings/item<?php echo isSet( $this->item['c_id'] ) ? '/id/' . $this->item['c_id'] : '' ?>" method="post">
<table cellspacing="0" cellpadding="6" class="tform">
	<tr>
		<td class="lb">Miasto:</td>
		<td class="inpy">
			<?php if( isSet( $this->error ) ) { ?>
				<input style="border:1px solid red;" type="text" name="city_name" value="" />
				<div class="formerror"><?php echo $this->error ?></div>
			<?php } else { ?>
				<input type="text" id="city_name" name="city_name" value="<?php echo $this->item['city_name'] ?>" />
			<?php } ?>
		</td>
	</tr>
	<tr>
		<td class="lb">Tekst PL:</td>
		<td class="inpy"><textarea style="height: 90px;" id="city_description_pl" name="city_description_pl"><?php echo $this->item['city_description_pl'] ?></textarea></td>
	</tr>
	<tr>
		<td class="lb">Tekst EN:</td>
		<td class="inpy"><textarea style="height: 90px;" id="city_description_en" name="city_description_en"><?php echo $this->item['city_description_en'] ?></textarea></td>
	</tr>
	<tr>
		<td class="lb">Tekst CS:</td>
		<td class="inpy"><textarea style="height: 90px;" id="city_description_cs" name="city_description_cs"><?php echo $this->item['city_description_cs'] ?></textarea></td>
	</tr>
	<tr>
		<td class="lb">Tekst jako główny:</td>
		<td class="inpy">
			<label><input <?php echo ( $this->item['main_page'] == 'yes' ) ? 'checked="checked"' : ''; ?> type="radio" name="main_page" value="yes" /> Tak</label>
			<label><input <?php echo ( $this->item['main_page'] == 'no' ) ? 'checked="checked"' : ''; ?> type="radio" name="main_page" value="no" /> Nie</label>
		</td>
	</tr>
	<tr>
		<td class="lb">Galeria:</td>
		<td class="inpy">
			<select name="galeries_g_id">
			<?php foreach( $this->galleriesList as $value ) { ?>
				<option <?php echo ( $this->item['galeries_g_id'] == $value['g_id'] ) ? 'selected="selected"' : ''; ?> value="<?php echo $value->g_id ?>"><?php echo $value->name ?></option>
			<?php } ?>
			</select>
		</td>
		
	</tr>
	
	<tr>
		<td class="lb">Dodaj lokalizację:</td>
		<td class="inpy2"><div id="google_map" name="google_map" style="width:508px; height:300px"></div></td>	
		<td><input type="hidden" id="city_loc" name="city_loc" value="<?php echo $this->item['city_loc'];?>" /> </td>
	</tr>
</table>
</form>

<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpsetings/list">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" id="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
	</tr>
</table>